<%@page pageEncoding="UTF-8" %>
<!doctype html>
<html lang="zh-cmn">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title></title>
    <%@include file="/WEB-INF/jsp/comm/head.jsp"%>
</head>
<body>
    <div class="container">
        <div class="row col-md-8">
            <form method="post" class="form-horizontals" id="add">
                <div class="form-group form-inline">
                    <label for="" class="col-md-3 control-label">用户名：</label>
                    <input type="text" class="form-control" name="userCode" readonly="readonly" value="${user.userCode}">
                </div>
                <div class="form-group form-inline">
                    <label for="" class="col-md-3 control-label">用户名称：</label>
                    <input type="text" class="form-control" name="userName" readonly="readonly" value="${user.userName}">
                </div>
                <div class="form-group">
                    <label for="" class="col-md-3 control-label">性别：</label>
                    <label class="radio-inline">
                        <input type="hidden" name="hidSex" value="${user.sex}">
                        <input type="radio" name="sex" value="男" /> 男
                    </label>
                    <label class="radio-inline">
                        <input type="radio" name="sex" value="女"/> 女
                    </label>
                </div>
                <div class="form-group form-inline">
                    <label for="" class="col-md-3 control-label">年龄：</label>
                    <input type="text" class="form-control" name="age" value="${user.age}">
                </div>
                <div class="form-group form-inline">
                    <label for="" class="col-md-3 control-label">联系电话：</label>
                    <input type="text" class="form-control" name="phoneTel" value="${user.phoneTel}">
                </div>
                <div class="form-group form-inline">
                    <label for="" class="col-md-3 control-label">电子邮箱：</label>
                    <input type="text" class="form-control" name="email" value="${user.email}">
                </div>
                <div class="col-md-offset-4">
                    <button type="button" id="sub" class="btn btn-success">保存修改</button>&nbsp;
                    <button type="reset" class="btn btn-primary">取消</button>
                </div>
            </form>
        </div>
    </div>
</body>

<%@include file="/WEB-INF/jsp/comm/foot.jsp"%>
<script>
    $(function () {
        var sex= $("[name=hidSex]").val();
        $("[name=sex][value='"+sex+"']").attr("checked","checked");
    })
    $('#sub').click(function(){
        var aa = $('#add').serialize();
        $.post(ctx+'sys/user/editUser',aa,function(msg){
            toastr.success(msg);
        });
    });
</script>

</html>
